//
//  LazyGridDemo.swift
//  FirstDemo
//
//  Created by liy on 2025/1/22.
//网格

import SwiftUI

struct LazyGridDemo: View {
  var body: some View {
    ScrollView {
      LazyVGrid(columns: [GridItem(.fixed(100), alignment: .trailing /*每列对齐方式*/),
                          GridItem(.fixed(100)),
                          GridItem(.fixed(100))],
								alignment: .center, //整体对齐方式
								pinnedViews: [.sectionHeaders] /*固定的视图*/) {
				Section {
					ForEach(0 ..< 100) { idx in
						
						Text("Hello\(idx)")
							.padding()
							.background(.red)
					}
				} header: {
					Text("相册")
						.font(.title)
						.background(.blue)
				}

      }
    }
  }
}

#Preview {
  LazyGridDemo()
}
